import pinia from '@/store'
import 'virtual:uno.css'
import { createSSRApp } from 'vue'
import * as filters from '~/utils/filters'
import App from './App.vue'
import api from './config/api'
import navBar from '@/components/nav-bar/index.vue'
declare module 'vue' {
  export interface ComponentCustomProperties {
    $navigateTo: any
  }
}
export function createApp() {
  const app = createSSRApp(App)
  // 全局注册 NutToast 组件
  app.config.globalProperties.$api = api
  app.config.globalProperties.$navigateTo = (url: string) => {
    uni.navigateTo({
      url
    })
  }
  app.config.globalProperties.$filters = filters
  // app.component(copy);
  app.component('navBar', navBar)
  app.use(pinia)
  return {
    app
  }
}
